package com.chen.recruit.controller;

import com.chen.recruit.common.annotation.Log;
import com.chen.recruit.common.api.CommonResult;
import com.chen.recruit.common.enums.BusinessType;
import com.chen.recruit.common.valid.AddGroup;
import com.chen.recruit.common.valid.UpdateGroup;
import com.chen.recruit.domain.model.PageQuery;
import lombok.RequiredArgsConstructor;

import javax.validation.constraints.*;

import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.chen.recruit.domain.vo.PostCollectVo;
import com.chen.recruit.service.CollectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "收藏管理 CollectController")
@RequiredArgsConstructor
@RestController
@RequestMapping("/recruit/collect")
public class CollectController {

    private final CollectService collectService;

    @ApiOperation("新增收藏")
    @SaCheckPermission("recruit:collect:add")
    @Log(module = "招聘管理-我的收藏", businessType = BusinessType.INSERT)
    @PostMapping
    public CommonResult add(@Validated(AddGroup.class) @RequestBody PostCollectVo postCollectVo) {
        return null;
    }

    @ApiOperation("删除收藏")
    @SaCheckPermission("recruit:collect:delete")
    @Log(module = "招聘管理-我的收藏", businessType = BusinessType.DELETE)
    @DeleteMapping("/{collectIds}")
    public CommonResult remove(@NotEmpty(message = "主键不能为空") @PathVariable Integer[] collectIds) {
        return null;
    }

    @ApiOperation("更新收藏")
    @SaCheckPermission("recruit:collect:update")
    @Log(module = "招聘管理-我的收藏", businessType = BusinessType.UPDATE)
    @PutMapping
    public CommonResult update(@Validated(UpdateGroup.class) @RequestBody PostCollectVo postCollectVo) {
        return null;
    }

    @ApiOperation("获取收藏详细信息")
    @SaCheckPermission("recruit:collect:get")
    @GetMapping("/{collectId}")
    public CommonResult getInfo(@NotNull(message = "主键不能为空") @PathVariable("collectId") Integer collectId) {
        return null;
    }

    @ApiOperation("查询收藏列表")
    @SaCheckPermission("recruit:collect:list")
    @GetMapping("/list")
    public CommonResult list(PostCollectVo postCollectVo, PageQuery pageQuery) {
        return null;
    }

}
